<?php
use \Firebase\JWT\JWT;
require './vendor/autoload.php';
ini_set("display_errors","On");
error_reporting(E_ALL);

$config =  [
    'username' => 1,
    'password' => 1
];

$params = $_GET;

if ($config != $params) {
    echo 'username or password Wrong';
    die;
}

$key = "wrkwd";

$payload = array(
    "iat" => time(),
    "nbf" => time(),
    'exp' => time()+60,
    'id' => 1
);

$jwt = JWT::encode($payload, $key);
echo $jwt;


